import Vue from 'vue'
import Router from 'vue-router'
import store from '../store'
import home from '../views/home'

Vue.use(Router)

const router = new Router({
  mode: 'history',
  base: '/src/app/h5/',
  routes: [
    {
      path: '/',
      name: 'home',
      component: home,
      props: true,
    },
  ],
})

router.beforeEach((to, from, next) => {
  store.dispatch('getBaseInfo')
  next()
})

export default router
